package com.itc.bi.api.factory;

import com.itc.bi.api.BiService;
import com.itc.bi.api.dto.DataSetDto;
import com.itc.bi.api.vo.DataSetVO;
import com.itc.common.core.domain.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BiFactory implements FallbackFactory<BiService> {
    private static final Logger log = LoggerFactory.getLogger(BiFactory.class);

    @Override
    public BiService create(Throwable throwable)
    {
        return new BiService()
        {
            @Override
            public R<DataSetVO> queryDataSetData(DataSetDto dto) {
                return R.fail("获取数据异常");
            }
            @Override
            public R<List> column(DataSetDto dto) {
                return R.fail("获取数据异常");
            }
        };
    }
}
